package net.zjitc.service.impl;

import net.zjitc.dao.UserDao;
import net.zjitc.dao.impl.UserDaoImpl;
import net.zjitc.domain.User;
import net.zjitc.service.UserService;

import java.sql.SQLException;
import java.util.List;

/**
 * 2 * @Author: 洪瑶
 * 3 * @Date: 2018/10/8 18:41
 * 4
 */
public class UserServiceImpl implements UserService {
    UserDao dao = new UserDaoImpl();

    @Override
    public List<User> findAll() throws SQLException {
        return dao.sqlfindAll();
    }

    @Override
    public void delete(int id) throws SQLException {
        dao.sqldelete(id);;
    }

    @Override
    public User login(String name, String psw) throws SQLException {
        return dao.sqllogin(name,psw);
    }

    @Override
    public Boolean sqlregister(User user) throws SQLException {
        return dao.sqlregister(user);
    }
}
